package com.taoes.simpledocker.controller.container;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Collections;
import java.util.Map;

/**
 * TODO: please input file info
 *
 * @author 枕上江南 zhoutao825638@vip.qq.com
 * @date 2021/12/5 1:18 上午
 */

@ApiModel
@Data
public class OperateContainerRequest {

    /**
     * 操作的容器
     */
    @ApiModelProperty(value = "操作的容器",required = true)
    private String containerId;

    /**
     * 操作选项
     */
    @ApiModelProperty(value = "操作容器参数，在删除容器中可设置force：true（强制删除）；removeVolume" +
            "：true，删除容器时删除挂载卷",required = false)
    private Map<String, String> properties;

    public Map<String, String> findProperties() {
        final Map<String, String> properties = this.getProperties();
        if (properties == null) {
            return Collections.emptyMap();
        }
        return properties;
    }
}
